package com.fz.old;

import com.fz.JdbcUtils;

import java.util.List;

public class AppJdbc {
    public static void main(String[] args) {
//        String sql = "SELECT `id`, `username` FROM `user` WHERE `id` = 1";
//        User u = JdbcUtils.select(sql, User.class);
//        System.out.println(u);
        String sql1 = "select `id`,`name`,`age` from `human` where `age`>=18 ";
        String sql2 = "select `id`,`name`,`age` from `human` where `name`='Nano'";
        String sql3 = "select `id`,`name`,`age` from `human` where `name`='Neo'and age=15";
        String sql4 = "select exists(select * from human where `name`='Tom')";
        String sql5 = "select exists(select * from human where `age`<10)";
//        String sql6 = "select  `id`,`name`,`age` from `human` where `name`='Neo'and age=15";
//        String sql7 = "select  `id`,`name`,`age` from `human` where `name`='Neo'and age=15";
        List<Human> u1s = JdbcUtils.selects(sql1, Human.class);
        Human u2 = JdbcUtils.select(sql2, Human.class);
        Human u3 = JdbcUtils.select(sql3, Human.class);
        Human u4 = JdbcUtils.select(sql4, Human.class);
        Human u5 = JdbcUtils.select(sql5, Human.class);
        System.out.println(u1s);
        System.out.println(u2);
        System.out.println(u3);
        System.out.println(u4);
        System.out.println(u5);




    }
}
